<template>
  <view class="content_list">
    <view class="content_list_item" v-for="(item,index) in dataList" :key="item.id">
      <!-- 图片 -->
      <view @click="handlerItem(item)">
        <uniImage :src="item.pic"
               mode="aspectFill"
               class="list_image"
        ></uniImage>
      </view>
      <view>{{item.title}}</view>
    </view>
  </view>
</template>

<script>
export default {
  name: "product",
  props: {
    dataList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {}
  },
  methods: {
    handlerItem(item) {
      this.$emit("handlerItem", item)
    }
  },
  created() {

  },
}
</script>

<style lang="less" scoped>
.content_list {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  background-color: #efefef;


  .content_list_item {
    border-radius: 5px;
    background-color: white;
    width: 49%;
    height: 230px;
    margin-bottom: 5px;
    box-shadow: 1px 2px 3px -3px black;


    view:nth-child(1) {
      height: 190px;

      .list_image {
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

    }

    view:nth-child(2) {
      height: 40px;
      line-height: 40px;
      text-align: center;
    }

  }

}
</style>
